package io.xdag.exception;

import io.xdag.beans.BaseEnum;


public class ConverterException extends BaseException {

	private static final long serialVersionUID = 1L;

	public ConverterException(Throwable cause, Enum enumObject) {
		super(enumObject.getText(),cause, enumObject.getCode());
	}

	public static enum Enum implements BaseEnum<Long>{
		BASECODE_EXCEPTION(generateErrorCode(BaseException.Enum.CONVERTER_EXCEPTION,1),"基础错误"), 
		CONVERTER_EXCEPTION(generateErrorCode(BaseException.Enum.CONVERTER_EXCEPTION,2),"转换错误"), 
		
		CUSTOMIZE_MESSAGE_EXCEPTION(generateErrorCode(BaseException.Enum.CONVERTER_EXCEPTION,999),"自定义错误信息内容"),
		;
		


		private Long code;

		private String text;

		Enum(Long code, String text) {
	        this.code = code;
	        this.text = text;
	    }

	    public Long getIntCode()
	    {
	    	return getCode();
	    }
	    public Long getCode() {
	        return code;
	    }

	    public void setCode(Long code) {
	        this.code = code;
	    }

	    public String getText() {
	        return text;
	    }

	    public void setText(String text) {
	        this.text = text;
	    }
	    
	    @Override
	    public String toString() {
	        return text;
	    }
		
	}
}
